$gwx_XC_17=function(_,_v,_n,_p,_s,_wp,_wl,$gwn,$gwl,$gwh,wh,$gstack,$gwrt,gra,grb,TestTest,wfor,_ca,_da,_r,_rz,_o,_oz,_1,_1z,_2,_2z,_m,_mz,nv_getDate,nv_getRegExp,nv_console,nv_parseInt,nv_parseFloat,nv_isNaN,nv_isFinite,nv_decodeURI,nv_decodeURIComponent,nv_encodeURI,nv_encodeURIComponent,$gdc,nv_JSON,_af,_gv,_ai,_grp,_gd,_gapi,$ixc,_ic,_w,_ev,_tsd){return function(path,global){
if(typeof global==='undefined'){if (typeof __GWX_GLOBAL__==='undefined')global={};else global=__GWX_GLOBAL__;}if(typeof __WXML_GLOBAL__ === 'undefined') {__WXML_GLOBAL__={};
}__WXML_GLOBAL__.modules = __WXML_GLOBAL__.modules || {};
var e_={}
if(typeof(global.entrys)==='undefined')global.entrys={};e_=global.entrys;
var d_={}
if(typeof(global.defines)==='undefined')global.defines={};d_=global.defines;
var f_={}
if(typeof(global.modules)==='undefined')global.modules={};f_=global.modules || {};
var p_={}
__WXML_GLOBAL__.ops_cached = __WXML_GLOBAL__.ops_cached || {}
__WXML_GLOBAL__.ops_set = __WXML_GLOBAL__.ops_set || {};
__WXML_GLOBAL__.ops_init = __WXML_GLOBAL__.ops_init || {};
var z=__WXML_GLOBAL__.ops_set.$gwx_XC_17 || [];
function gz$gwx_XC_17_1(){
if( __WXML_GLOBAL__.ops_cached.$gwx_XC_17_1)return __WXML_GLOBAL__.ops_cached.$gwx_XC_17_1
__WXML_GLOBAL__.ops_cached.$gwx_XC_17_1=[];
(function(z){var a=11;function Z(ops){z.push(ops)}
Z([3,'main'])
Z([3,'#FA7B14'])
Z([3,'change'])
Z([3,'rate'])
Z([[7],[3,'score']])
Z([1,5])
Z([1,30])
Z([[2,'<'],[[6],[[7],[3,'all_urls']],[3,'length']],[1,5]])
})(__WXML_GLOBAL__.ops_cached.$gwx_XC_17_1);return __WXML_GLOBAL__.ops_cached.$gwx_XC_17_1
}
__WXML_GLOBAL__.ops_set.$gwx_XC_17=z;
__WXML_GLOBAL__.ops_init.$gwx_XC_17=true;
var x=['./pages/comment/addComment/addComment.wxml'];d_[x[0]]={}
var m0=function(e,s,r,gg){
var z=gz$gwx_XC_17_1()
var oTC=_n('view')
_rz(z,oTC,'class',0,e,s,gg)
var oVC=_mz(z,'tui-rate',['active',1,'bindchange',1,'class',2,'current',3,'quantity',4,'size',5],[],e,s,gg)
_(oTC,oVC)
var cUC=_v()
_(oTC,cUC)
if(_oz(z,7,e,s,gg)){cUC.wxVkey=1
}
cUC.wxXCkey=1
_(r,oTC)
return r
}
e_[x[0]]=e_[x[0]]||{f:m0,j:[],i:[],ti:[],ic:[]}
if(path&&e_[path]){
return function(env,dd,global){$gwxc=0;var root={"tag":"wx-page"};root.children=[]
;g="$gwx_XC_17";var main=e_[path].f
if (typeof global==="undefined")global={};global.f=$gdc(f_[path],"",1);
try{
main(env,{},root,global);
_tsd(root)
}catch(err){
console.log(err)
}
;g="";
return root;
}
}
}
}(__g.a,__g.b,__g.c,__g.d,__g.e,__g.f,__g.g,__g.h,__g.i,__g.j,__g.k,__g.l,__g.m,__g.n,__g.o,__g.p,__g.q,__g.r,__g.s,__g.t,__g.u,__g.v,__g.w,__g.x,__g.y,__g.z,__g.A,__g.B,__g.C,__g.D,__g.E,__g.F,__g.G,__g.H,__g.I,__g.J,__g.K,__g.L,__g.M,__g.N,__g.O,__g.P,__g.Q,__g.R,__g.S,__g.T,__g.U,__g.V,__g.W,__g.X,__g.Y,__g.Z,__g.aa);if(__vd_version_info__.delayedGwx||false)$gwx_XC_17();	if (__vd_version_info__.delayedGwx) __wxAppCode__['pages/comment/addComment/addComment.wxml'] = [$gwx_XC_17, './pages/comment/addComment/addComment.wxml'];else __wxAppCode__['pages/comment/addComment/addComment.wxml'] = $gwx_XC_17( './pages/comment/addComment/addComment.wxml' );
	;__wxRoute = "pages/comment/addComment/addComment";__wxRouteBegin = true;__wxAppCurrentFile__="pages/comment/addComment/addComment.js";define("pages/comment/addComment/addComment.js",function(require,module,exports,window,document,frames,self,location,navigator,localStorage,history,Caches,screen,alert,confirm,prompt,XMLHttpRequest,WebSocket,Reporter,webkit,WeixinJSCore){
"use strict";var e=require("../../../@babel/runtime/helpers/interopRequireDefault"),t=require("../../../@babel/runtime/helpers/createForOfIteratorHelper"),r=e(require("../../../@babel/runtime/regenerator")),a=require("../../../@babel/runtime/helpers/asyncToGenerator"),n=require("../../../request/api"),s=require("../../../utils/util"),u=getApp();Page({data:{score:5,order_id:null,order_details:{},content:"",product_id:null,urls:[],all_urls:[]},onLoad:function(e){this.setData({order_id:e.order_id||"",product_id:e.product_id||""}),this.getProductDetail()},change:function(e){this.setData({score:e.detail.index})},textareaChange:function(e){var t=e.detail.value;console.log(t,e),this.setData({content:t})},getProductDetail:function(){var e=this;return a(r.default.mark((function t(){var a,s;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,n.getProductDetail)({product_id:e.data.product_id});case 2:a=t.sent,s=a.data,e.setData({order_details:s});case 5:case"end":return t.stop()}}),t)})))()},previewImage:function(e){console.log(e);var t=e.currentTarget.dataset.img;wx.previewImage({urls:[t]})},chooseImage:function(){var e,n=this,s=this.data,o=s.urls,i=s.all_urls;wx.chooseImage({count:5,sizeType:["original","compressed"],sourceType:["album","camera"],success:(e=a(r.default.mark((function e(a){var s,c,l,d,p;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(wx.showLoading({title:"上传图片中"}),!((s=a.tempFilePaths).length+o.length>5)){e.next=5;break}return u.showToast("图片最多上传5张"),e.abrupt("return");case 5:e.prev=5,c=t(s),e.prev=7,c.s();case 9:if((l=c.n()).done){e.next=18;break}return d=l.value,e.next=13,n.uploadImage(d);case 13:p=e.sent,o.push(p.url),i.push(p.all_url);case 16:e.next=9;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(7),c.e(e.t0);case 23:return e.prev=23,c.f(),e.finish(23);case 26:wx.hideLoading(),u.showToast("图片上传成功"),n.setData({urls:o,all_urls:i}),e.next=35;break;case 31:e.prev=31,e.t1=e.catch(5),wx.hideLoading(),u.showToast("上传失败，请重试");case 35:case"end":return e.stop()}}),e,null,[[5,31],[7,20,23,26]])}))),function(t){return e.apply(this,arguments)}),fail:function(e){wx.hideLoading(),u.showToast("上传失败，请重试")}})},uploadImage:function(e){return new Promise((function(t,r){wx.uploadFile({url:u.globalData._url+"api/Upload/uploadImg",filePath:e,name:"file",success:function(e){var a=JSON.parse(e.data);1e3==a.code?t(a.data):r()}})}))},deleteImg:function(e){var t=e.currentTarget.dataset.index,r=this.data,a=r.urls,n=r.all_urls;console.log(a),a.splice(t,1),n.splice(t,1),u.showToast("删除成功"),this.setData({urls:a,all_urls:n})},submit:s.debounce((function(){this.getComment()}),1e3),getComment:function(){var e=this;return a(r.default.mark((function t(){var a,s,o,i,c,l,d,p;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=e.data,s=a.score,o=a.order_id,i=a.content,c=a.product_id,l=a.urls,d={score:s,order_id:o,content:i,product_id:c,images:l},!(s<1)){t.next=7;break}return u.showToast("请评价星级"),t.abrupt("return");case 7:if(""!=i){t.next=12;break}return u.showToast("请输入内容"),t.abrupt("return");case 12:if(l.length){t.next=15;break}return u.showToast("请上传图片"),t.abrupt("return");case 15:return t.next=17,(0,n.getComment)(d);case 17:p=t.sent,u.showToast(p.msg),setTimeout((function(){wx.navigateBack({delta:1})}),1e3);case 20:case"end":return t.stop()}}),t)})))()}});
},{isPage:true,isComponent:true,currentFile:'pages/comment/addComment/addComment.js'});require("pages/comment/addComment/addComment.js");